<%--
  Created by IntelliJ IDEA.
  User: WheelChen
  Date: 2017/7/6
  Time: 14:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="/static/common/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/global.css">
    <link rel="stylesheet" href="/static/css/table.css">
    <script src="../../static/common/axios.min.js"></script>
</head>
<body>
<div style="margin: 15px;" id="vue" v-cloak>
    <div v-show="show">
        <blockquote class="layui-elem-quote" style="overflow: hidden">
            <%--<a href="#" class="layui-btn layui-btn-small" @click="add">--%>
            <%--<i class="layui-icon">&#xe608;</i> 添加--%>
            <%--</a>--%>
            <%--<a href="#" class="layui-btn layui-btn-small" id="detelBatch">--%>
            <%--<i class="layui-icon">&#x1006;</i> 批量删除--%>
            <%--</a>--%>
            <%--<a href="#" class="layui-btn layui-btn-small" id="edit">--%>
            <%--<i class="layui-icon">&#xe642;</i> 修改--%>
            <%--</a>--%>
            <div style="float: right">
                <input type="text" id="searchVal">
                <a href="javascript:;" class="layui-btn layui-btn-small">
                    <i class="layui-icon">&#xe615;</i> 查询
                </a>
            </div>
        </blockquote>
        <fieldset class="layui-elem-field">
            <legend>实习生列表</legend>
            <div class="layui-field-box layui-form">
                <table class="layui-table admin-table">
                    <thead>
                    <tr>
                        <%--<th style="width: 30px;"><input  type="checkbox" lay-filter="allselector" lay-skin="primary"></th>--%>
                        <th>姓名</th>
                        <th>班级</th>
                        <th>学号</th>
                        <th>手机号</th>
                        <th>实习单位</th>
                        <th>实习岗位</th>
                        <th>实习状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <%--内容容器--%>
                    <tbody id="content">
                    </tbody>
                </table>
            </div>
        </fieldset>

        <%--分页容器--%>
        <div class="admin-table-page">
            <div id="paged" class="page">
            </div>
        </div>
    </div>

    <div v-show="!show">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>学生基本信息</legend>
        </fieldset>
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="user.realname" class="layui-input">
                </div>
                <label class="layui-form-label layui-form-newlabel_ren">学号</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="user.workid" class="layui-input " readonly>
                </div>
                <label class="layui-form-label">性别</label>
                <div class="layui-input-inline">
                    <div v-if="user.sex == 1">
                        <label class="layui-form-label" style="text-align: center">男</label>
                    </div>
                    <div v-else="user.sex == 2">
                        <label class="layui-form-label" style="text-align: center">女</label>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">学校</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="university.name" class="layui-input" readonly>
                </div>
                <label class="layui-form-label">学院</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="school.name" class="layui-input" readonly>
                </div>
                <label class="layui-form-label">系</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="department.name" class="layui-input" readonly>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">专业</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="major.name" autocomplete="off" class="layui-input" readonly>
                </div>

                <label class="layui-form-label">班级</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="clazz.name" autocomplete="off" class="layui-input" readonly>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">毕设指导老师</label>
                <div class="layui-input-inline">
                    <div v-if="teacherInfoPaperName == '' ">
                        <input type="text" value="暂无" class="layui-input" readonly>
                    </div>
                    <div v-else>
                        <input type="text" v-model="teacherInfoPaperName" class="layui-input" readonly>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">实习指导老师</label>
                <div class="layui-input-inline">
                    <div v-if="teacherInfoInternName== ''">
                        <input type="text" value="暂无" class="layui-input" readonly>
                    </div>
                    <div v-else>
                        <input type="text" v-model="teacherInfoInternName" class="layui-input" readonly>
                    </div>
                </div>
                <label class="layui-form-label">指导状态</label>
                <div class="layui-input-inline">
                    <div v-if="studentInfo.advisestate==1">
                        <input type="text" value="导师申请中" class="layui-input" readonly>
                    </div>
                    <div v-else="studentInfo.advisestate==2">
                        <input type="text" value="导师已确认" class="layui-input" readonly>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">实习分数</label>
                <div class="layui-input-inline">
                    <input type="text" v-model="studentInfo.internscore" class="layui-input" readonly>
                </div>
                <label class="layui-form-label">实习状态</label>
                <div class="layui-input-inline">
                    <div v-if="studentInfo.state==1">
                        <input type="text" value="未实习" class="layui-input" readonly>

                    </div>
                    <div v-else-if="studentInfo.state==2">
                        <input type="text" value="实习申请中" class="layui-input" readonly>

                    </div>
                    <div v-else-if="studentInfo.state==3">
                        <input type="text" value="实习中" class="layui-input" readonly>

                    </div>
                    <div v-else-if="studentInfo.state==4">
                        <input type="text" value="实习变更申请中" class="layui-input" readonly>

                    </div>
                    <div v-else="studentInfo.state==-1">
                        <input type="text" value="已毕业" class="layui-input" readonly>
                    </div>
                </div>

            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">实习评价</label>
                <div class="layui-input-inline">
                    <div class="layui-textarea"disabled name="advisorappraise" id="advisorappraise" style="width: 500px;height:100px;"></div>
                </div>
                <%--<textarea v-model="studentInfo.advisorappraise" disabled="disabled" style="width: 300px;height: 100px;"></textarea>--%>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="button" class="layui-btn" @click="reload" value="返回">
                </div>
            </div>
        </form>
    </div>

</div>
<script>
    var teacherUserId = ${sessionScope.currentUser.getId()};
    var teacher={};
    axios.get('/teacherInfo/findOneDetail/'+teacherUserId)
        .then(function (response) {
            console.log(response.data.data);
            teacher = response.data.data.teacherInfo;
        })
        .catch(function (msg) {
            console.log(msg);
        });
    console.log(teacher);
</script>
<!--模板-->
<script type="text/html" id="tpl">
    {{# layui.each(d.data, function(index, item){ }}
    <tr>
        <td> {{item.studentInfoDetail.user.realname || "-"}}</td>
        <td> {{item.studentInfoDetail.clazz.name || "-"}}</td>
        <td> {{item.studentInfoDetail.user.workid || "-"}}</td>
        <td>
            {{item.studentInfoDetail.user.mobilephone || "-"}}
            <input type="button" class="layui-btn-mini" value="显示">
        </td>
        <td>
            {{# if(item.orgInfo != null){ }}
            <a href="javascript:;" data-opt="org" data-id="{{ item.orgInfo.id }}">{{ item.orgInfo.fullname }}</a>
            {{# }; }}
        </td>
        <td>
            {{# if(item.internInfo != null){ }}
            {{ item.internInfo.position }}
            {{# }; }}
        </td>

        <%--状态 Begin--%>
        {{# if(item.studentInfoDetail.studentInfo.state == 1 || item.studentInfoDetail.studentInfo.state == ""){ }}
        <td>未实习</td>
        {{# }; }}
        {{# if(item.studentInfoDetail.studentInfo.state == 2){ }}
        <td>实习申请中</td>
        {{# }; }}
        {{# if(item.studentInfoDetail.studentInfo.state == 3){ }}
        <td>实习中</td>
        {{# }; }}
        {{# if(item.studentInfoDetail.studentInfo.state == 4){ }}
        <td>实习变更申请中</td>
        {{# }; }}
        <%--状态 End--%>

        <td>
            <a href="javascript:;" data-id="{{item.studentInfoDetail.user.id}}" data-opt="more"
               class="layui-btn layui-btn-normal layui-btn-mini">学生详情</a>

            {{# if(item.studentInfoDetail.studentInfo.advisorappraise == ''){ }}
            <a href="javascript:;" data-id="{{item.studentInfoDetail.studentInfo.id}}" data-opt="appraise" class="layui-btn layui-tn-normal layui-btn-mini">实习评价</a>
            {{# }; }}

            {{# if(item.studentInfoDetail.studentInfo.advisestate == 2){ }}
            <a href="javascript:;" target="_self" data-id="{{item.studentInfoDetail.user.id}}" data-opt="internLog"
               class="layui-btn layui-btn-mini">实习日志</a>
            <a href="javascript:;" target="_self" data-id="{{item.studentInfoDetail.user.id}}" data-opt="internInfo"
               class="layui-btn layui-btn-mini">实习详情</a>
            <a href="/teacher/emploDetail?id={{item.studentInfoDetail.user.id}}" target="_self" class="layui-btn layui-btn-normal layui-btn-mini">就业情况</a>
            {{# }; }}

            {{# if(item.studentInfoDetail.studentInfo.advisestate == 1){ }}
            <a href="javascript:;" target="_self" data-id="{{item.studentInfoDetail.studentInfo.id}}" data-opt="accept"
               class="layui-btn layui-btn-warm layui-btn-mini">接收该学生</a>
            {{# }; }}

            {{# if(item.internInfo!=null&&item.internInfo.state==2&&item.studentInfoDetail.studentInfo.advisestate == 2&&item.studentInfoDetail.studentInfo.state == 2){ }}
            <a href="javascript:;" target="_self" data-id="{{item.studentInfoDetail.studentInfo.id}}" data-opt="review"
               class="layui-btn layui-btn-danger layui-btn-mini">实习审核</a>
            {{# }; }}
            {{# if(item.studentInfoDetail.studentInfo.advisestate == 2&&item.studentInfoDetail.studentInfo.state == 4){ }}
            <a href="javascript:;" target="_self" data-id="{{item.studentInfoDetail.studentInfo.id}}" data-opt="internChange"
               class="layui-btn layui-btn-danger layui-btn-mini">实习变更审核</a>
            {{# }; }}

        </td>
    </tr>
    {{# }); }}
</script>
<!--审核实习模板-->
<script type="text/html" id="detailTpl">
    {{# var item=d }}
    <div class="layui-form-item">
        <label class="layui-form-label">实习单位</label>
        <div class="layui-input-inline">
            <input type="text" name="company" autocomplete="off" class="layui-input" value="{{ item.orgInfo.fullname }}" disabled>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">实习岗位</label>
        <div class="layui-input-inline">
            <input type="text" name="position" autocomplete="off" class="layui-input" value="{{ item.internInfo.position }}" disabled>
        </div>
        <label class="layui-form-label">岗位介绍</label>
        <div class="layui-input-inline">
            <input type="text" name="jobIntro" autocomplete="off" class="layui-input" value="{{ item.internInfo.jobintro }}" disabled>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">实习内容</label>
        <div class="layui-input-inline">
            <textarea type="text" name="content" autocomplete="off" class="layui-input" value="{{ item.internInfo.jobcontent }}" disabled>{{ item.internInfo.jobcontent }}</textarea>
        </div>
        <label class="layui-form-label">实习成果</label>
        <div class="layui-input-inline">
            <textarea type="text" name="outcome" autocomplete="off" class="layui-input" value="{{ item.internInfo.outcome }}" disabled>{{ item.internInfo.outcome }}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开始时间</label>
        <div class="layui-input-inline">
            <input type="text" name="starttime" autocomplete="off" class="layui-input" value="{{ item.internInfo.start }}" disabled>
        </div>
        <label class="layui-form-label">结束时间</label>
        <div class="layui-input-inline">
            <input type="text" name="endtime" autocomplete="off" class="layui-input" value="{{ item.internInfo.end }}" disabled>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">实习单位指导人员</label>
        <div class="layui-input-inline">
            <input type="text" name="companyGuide" autocomplete="off" class="layui-input" value="{{ item.internInfo.instructor }}" disabled>
        </div>
        <label class="layui-form-label">单位指导联系方式</label>
        <div class="layui-input-inline">
            <input type="text" name="companyGuidePhone" autocomplete="off" class="layui-input" value="{{ item.internInfo.instructorphone }}" disabled>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">实习办公场地照片</label>
        <div class="layui-input-block">
            <img id="workEnvironment" style="height: 100px;width: 100px">
        </div>
    </div>
    <%--<div class="layui-form-item">--%>
        <%--<label class="layui-form-label">审核意见</label>--%>
        <%--<div class="layui-input-inline">--%>
            <%--<textarea id="auditsug" type="text" name="auditsug" autocomplete="off" class="layui-input" value="{{ item.internInfo.auditsug }}" style="width: 250px;height: 70px">{{ item.internInfo.auditsug }}</textarea>--%>
        <%--</div>--%>
    <%--</div>--%>
</script>
<!--实习情况审核评价模板-->
<script type="text/html" id="suggestion">
    {{# var item=d }}
    <div class="layui-form-item">
        <label class="layui-form-label">意见</label>
        <div class="layui-input-inline">
            <textarea id="auditsug" type="text" name="auditsug" v-model="item.auditsug" autocomplete="off" class="layui-input" style="width: 250px;height: 70px"></textarea>
        </div>
    </div>
</script>
<script src="../../static/common/vue.min.js"></script>
<script src="../../static/common/layui/layui.js"></script>
<script src="../../static/js/teacher/internLists.js"></script>
</body>
</html>

